package jamirr;

import java.util.Objects;

public final class AnnotationAttributeBuilder<T> {

    private final String name;
    private T value;
    private T defaultValue;
    private String aliasFor;
    private String aliasForAnnotation;

    public AnnotationAttributeBuilder(String name) {
        Objects.requireNonNull(name, "name cannot be null");
        this.name = name;
    }

    String getName() {
        return name;
    }

    public AnnotationAttributeBuilder<T> setValue(T value) {
        this.value = value;
        return this;
    }

    public AnnotationAttributeBuilder<T> setDefaultValue(T defaultValue) {
        this.defaultValue = defaultValue;
        return this;
    }

    public AnnotationAttributeBuilder<T> setAliasFor(String aliasFor) {
        this.aliasFor = aliasFor;
        return this;
    }

    public AnnotationAttributeBuilder<T> setAliasForAnnotation(String aliasForAnnotation) {
        this.aliasForAnnotation = aliasForAnnotation;
        return this;
    }

    public AnnotationAttribute<T> build() {
        return new AnnotationAttribute<>(
                name,
                value,
                defaultValue,
                aliasFor,
                aliasForAnnotation);
    }
}
